// src/App.tsx

import { HashRouter } from 'react-router-dom';
import Router from '@/router';
import { useEffect } from 'react';
import { useUserStore } from '@/store/userStore';

const App = () => {
  const { initUser } = useUserStore();

  useEffect(() => {
    const token = localStorage.getItem('token');
    if (token) {
      initUser();
    }
  }, [initUser]);

  return (
    <HashRouter>
      <Router />
    </HashRouter>
  );
};

export default App;